#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define vec vector<int>
#define y1 y_____hahahaha_____1

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48); return x * sgn;}

const int N = 1e3+10;

int n,m,R,ans,res;
db x[N],y[N],r[N],p[N],q[N],ansx,ansy,nowx,nowy;

db Rand(){return (db) rand() / RAND_MAX;}

int calc(db px,db py){
	db d = R;
	for(int i = 1;i <= n;i++){
		db dx = px - x[i],dy = py - y[i];
		d = min(d,sqrt(dx * dx + dy * dy) - r[i]);
	}
	int res = 0;
	for(int i = 1;i <= m;i++){
		db dx = px - p[i],dy = py - q[i],dis = sqrt(dx * dx + dy * dy);
		if(dis <= d) res++;
	}
	if(res > ans) ans = res,ansx = px,ansy = py;
	return res;
}

void simulateAl(){
	db T = 3500; nowx = ansx,nowy = ansy;
	while(T > 0.001){
		db nx = nowx + (Rand() * 2 - 1) * T,ny = nowy + (Rand() * 2 - 1) * T;
		int delta = calc(nx,ny) - calc(nowx,nowy);
		if(delta > 0) nowx = nx,nowy = ny;
		else if(exp(-delta / T) < Rand()) nowx = nx,nowy = ny;
		T *= 0.98;
	}
	for(int i = 1;i <= 1000;i++){
		db nx = ansx + (Rand() * 2 - 1) * T,ny = ansy + (Rand() * 2 - 1) * T;
		calc(nx,ny);
	}
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	srand(19491001);
	n = in,m = in,R = in; for(int i = 1;i <= n;i++) x[i] = in,y[i] = in,r[i] = in; for(int i = 1;i <= m;i++) p[i] = in,q[i] = in,ansx += p[i],ansy += q[i];
	ansx /= m; ansy /= m; ans = calc(ansx,ansy); 
	clock_t st_ime = clock();
	while((db)(clock() - st_ime) / CLOCKS_PER_SEC < 0.85) simulateAl();
	printf("%d\n",ans);
	return 0;
}
